/*
 * Copyright 2009 XueSong Guo.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.webwheel;

/**
 * WebWheel MVC框架的过滤器链接口。<br>
 * 此接口在{@link cn.webwheel.Filter#process(FilterChain)}方法中使用。
 */
public interface FilterChain {

    /**
     * 获得当前应用程序的上下文对象
     * @return 应用程序的上下文对象
     */
    WebContext getWebContext();

    /**
     * 获得此次http请求所对应的动作类实例。<br>
     * 此实例为懒惰式创建，当仅需要知道动作类类型的时候请使用{@link #getActionClass()}方法。
     * @return 动作类对象
     */
    Action getAction();

    /**
     * 获得此次http请求所对应的动作类类型。
     * @return 动作类类型
     */
    Class<? extends Action> getActionClass();

    /**
     * 继续执行过滤器链。
     * @return 应用程序是否已经处理了此次http请求
     * @throws Exception 任何异常
     */
    boolean go() throws Exception;
}
